﻿@model QizSmsSession
@{
    ViewBag.Title = "短信随访详情";
    var PreviewOnly = "True".Equals(Request["PreviewOnly"], StringComparison.CurrentCultureIgnoreCase);
                    //@Ajax.ActionLink("详情", "QizSmsSessionView", new { ID = item.QizSmsSessionID }, new AjaxOptions() { LoadingElementId = "OnLoadingSpan", UpdateTargetId = "dialogbox", OnComplete = "showDialog('短信随访详情');", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" })
}
@using (Ajax.BeginForm(new AjaxOptions()
{
    LoadingElementId="OnLoadingSpan",UpdateTargetId = "ListView",
    InsertionMode = InsertionMode.Replace,
    HttpMethod = "Post",
    OnSuccess = "$('#dialogbox').dialog('close');",
    OnFailure = "OnSiteError"
}))
{
    <p>
    <fieldset>
        <legend>
            <div class="catalog-title">
                @Html.DisplayFor(model => model.User.UserName)
                @Model.Timemark.ToString("yyyy-MM-dd HH:mm")
                @Html.DisplayFor(model => model.QizSmsSubjectMonthIdx.QizSmsSubject.QizSubject.Title)
                短信随访详情</div>
        </legend>
        <div class="not-null " style="vertical-align: middle; padding-top:2px;">
            <span>
                <img alt="检查时间(必须填写)" src="../../Content/Images/checkClock.jpg" style="padding: 0px;
                    vertical-align: middle" /></span> *检查时间(必须填写)：
                     @if (!PreviewOnly)
                     {
                         <span>
                            @Html.EditorFor(model => model.Timemark, "SubDialogDateTime")
                         </span>
                     }
                     else
                     {
                         <label>@Model.Timemark.ToString("yyyy-MM-dd")</label>
                     }

        </div>
        <table class="width">
            <tr>
                <th>
                    指标
                </th>
                <th>类型</th>
                <th>
                    短信时间
                </th>
                <th>
                    值
                </th>
                <th>单位</th>
                <th>
                    评价
                </th>
            </tr>
            @if (PreviewOnly)
            {
                foreach (var item in Model.QizSmsSessionDetails)
                {
                    <tr style="@(item.ValueAutoEvalution == "异常" ? "color:red" : "")">
                        <td>@Html.DisplayFor(model => item.QizSmsSubjDefine.QizSubjectDefine.QizItem.Title)
                        </td>
                        <td>@Html.DisplayFor(model => item.QizSmsSubjDefine.QizSubjectDefine.QizItem.TypeRef.OptionTitle)
                        </td>
                        <td>@item.Timemark.ToString("yyyy-MM-dd HH:mm")
                        </td>
                        <td>@Html.FixStrMiddle(item.UserValue, 16) 
                        </td>
                        <td>@Html.DisplayFor(model => item.QizSmsSubjDefine.QizSubjectDefine.QizItem.Unit)
                        </td>
                        <td>@Html.DisplayFor(model => item.ValueAutoEvalution)
                        </td>
                    </tr>
                }
            }
            else
            {
                foreach (var item in Model.QizSmsSessionDetails)
                {
                    <tr style="@(item.ValueAutoEvalution == "异常" ? "color:red" : "")">
                        <td>@Html.DisplayFor(model => item.QizSmsSubjDefine.QizSubjectDefine.QizItem.Title)
                        </td>
                        <td>@Html.DisplayFor(model => item.QizSmsSubjDefine.QizSubjectDefine.QizItem.TypeRef.OptionTitle)
                        </td>
                        <td>@item.Timemark.ToString("yyyy-MM-dd HH:mm")
                        </td>
                        <td>
                        <input type="text" name="@item.ID" value="@item.UserValue" />
                        </td>
                        <td>@Html.DisplayFor(model => item.QizSmsSubjDefine.QizSubjectDefine.QizItem.Unit)
                        </td>
                        <td>@Html.DisplayFor(model => item.ValueAutoEvalution)
                        </td>
                    </tr>
                }
            }
        </table>
        @if (!PreviewOnly)
        {
            <input type="submit" value="提交" /> 
        }
    </fieldset>
</p>
}
